1. Field of the Invention
The present invention relates to an image data color correction method of performing color correction for color image data read by a scanner or the like by using look-up tables.
2. Description of the Prior Art
In general, when a color image is read into an image processing apparatus such as a personal computer through a scanner or the like, the read image data does not always reproduce the gradation (color tone) of the original image properly because the color resolution of the scanner is influenced by the characteristics and the like of the color filter or CCD (Charge Coupled Device) in the scanner. For this reason, when the read image data is to be printed by a printer or displayed on a CRT (Cathode Ray Tube), color correction must be performed for the image data to reproduce the original gradation.
As this color correction method, a method using polynomial approximation or a three-dimensional look-up table (to be referred to as a 3D LUT or LUT hereinafter) is known. According to the method based on polynomial approximation, in general, the relationship between RGB (Red-Green-Blue) input data (R, G, and B) and their ideal values (R.sub.TRUE, G.sub.TRUE, and B.sub.TRUE) is approximated using a second degree polynomial (matrix expression) like equation (1) given below, and coefficients a10 to a39 are obtained by multiple regression analysis. Color correction is then done by approximation using equation (1) whose coefficients have been obtained. ##EQU1##
According to the method based on this polynomial approximation, no LUT file need be formed, and the memory capacity can be reduced accordingly. However, since this method requires complicated calculations, a long processing time is required.
In contrast to this, according to the method using an LUT, as disclosed in Japanese Patent Publication Sho 55 No. 30222, RGB (Red-Green-Blue) data (R, G, and B) are read by a scanner or the like first, and the read image data are then converted into density data (Dr, Dg, and Db). The density data are compressed into density data (Dr1, Dg1, and Db1) which can be expressed by a printer or the like with print ink. Thereafter, the data are A/D-converted to generate cyan, magenta, and yellow data (C1, M1, and Y1). In this case, by calculating density data (Dr2, Dg2, and Db2) backward to obtain the color data (C, M, and Y) of an image printed by a printer or the like, a function describing the relationship between the density data (Dr2, Dg2, and Db2) and the color data (C, M, and Y) on the image processing apparatus side can be obtained.
The image processing apparatus obtains the differences (C-C1, M-M1, and Y-Y1) between the original color data (C, M, and Y) and the color data (C1, M1, and Y1) obtained by reading the image with the scanner, and storing them as errors (.DELTA.C, .DELTA.M, and .DELTA.Y) in an LUT in advance. When the image processing apparatus is to print the image read by the scanner by using the printer, the apparatus adds the errors (.DELTA.C, .DELTA.M, and .DELTA.Y) to the color data (C1, M1, and Y1) to correct the color data into color data (C1+.DELTA.C, M1+.DELTA.M, and Y1+.DELTA.Y) so as to match the characteristics of the scanner with those of the printer, thereby correctly reproducing the color gradation of the original.
Assume that an LUT is prepared for all the gradation levels of image data read by the scanner. In this case, a large memory capacity is required to store the LUT. For this reason, an LUT is prepared for only representative points of the image data. When image data that deviate from the representative points are input, linear interpolation is performed for the LUT to perform color correction.
The conventional color correction method using the above LUT and linear interpolation for the LUT will be described further in detail with reference to FIG. 1 by taking a case in which an image on an original 1 is read by a scanner 2 to be displayed on a CRT 4 connected to a personal computer 3 as an example. As shown in FIG. 1, assuming that the image on the original 1 has color components (X1, Y1, and Z1) (the X, Y, and Z coordinates of CIE standard calorimetric system) in the XYZ calorimetric system, the scanner 2 color-separates the image on the original 1 into the three primary colors R, G, and B, and outputs data (IR, IG, and IB) in the RGB colorimetric system to the personal computer 3. These data (IR, IG, and IB) each represent the 256 gradation levels of each color component in a general personal computer.
When the CRT 4 complies with the NTSC (National Television System Committee) system, the data (IR, IG, and IB) read by the scanner 2 themselves preferably match with values (ideal values) according to the NTSC system. As described above, however, since the color resolution of the scanner is influenced by the color filter or the like, the read data do not always comply with the NTSC system. For this reason, color correction must be performed in the above manner.
The XYZ calorimetric system values (X1, Y1, and Z1) of the original 1 in FIG. 1 can be inverted into RGB calorimetric system data (OR, OG, and OB) according to the arithmetic processing defined by the NTSC system. In addition, the input data (IR, IG, and IB) to the personal computer 3 in this case can be experimentally obtained by reading the original 1 with the scanner 2. When, therefore, the data (OR, OG, and OB) with respect to the data (X1, Y1, and Z1) on the CRT 4 and the actual input data (IR, IG, and IB) are obtained a plurality of numbers of times within the color reproduction range of the scanner, their relationship can be expressed by a function upon polynomial approximation.
By using the function obtained in this manner, the differences (OR-IR, OG-IG, and OB-IB) between the input data (IR, IG, and IB) at representative points (to be described later) and the data (OR, OG, and OB) (ideal values) complying with the NTSC system. The obtained differences are set as errors E1 (E1r, E1g, and E1b) to create a first look-up table A in FIG. 1. This table is stored in a memory 5 of the personal computer 3.
Upon reception of data (.DELTA.R, .DELTA.G, and .DELTA.B) from the scanner 2, the personal computer 3 serving as an image processing apparatus having the first look-up table A looks up the look-up table A to read the errors E1 (.DELTA.R, .DELTA.G, and .DELTA.B) defined with respect to the data (IR, IG, and IB), and performs correction computations: EQU OR=IR+.DELTA.R (2a) EQU OG=IG+.DELTA.G (2b) EQU OB=IB+.DELTA.B (2c)
to correct the input data (IR, IG, and IB) into the data (OR, OG, and OB).
Assume that the errors E1 for all the colors that can be used by the personal computer 3 are stored as an LUT. In this case, although color correction can be directly performed for all input data, when, for example, 24-bit color display (16,000,000-color display) is to be performed, a memory capacity as large as 48 Mbytes is required. That is, this technique is not practical.
Assume that 256-gradation level display (16,000,000-color display) is to be performed for each of R, G, and B components, as indicated by the concept shown in FIG. 2. In this case, each of the R, G, and B components in a three-dimensional spatial coordinate system is divided in the form of a lattice in units of, e.g., eight gradation levels (a predetermined number of gradation levels) as one step, and a first look-up table A is formed from only the errors between the image data at the respective lattice points and the representative points. With this operation, the size of the LUT can be reduced, and hence the capacity of the memory 5 can be saved. The errors with respect to the image data at the representative points will be referred to as first errors hereinafter. That is, the first look-up table A contains the first errors.
In the case shown in FIG. 2, the R, G, and B components are divided into four equal parts in units of eight gradation levels as one step in the respective directions of R, G, and B. However, even if, for example, they are divided into 32 equal parts to increase the number of representative points, the resultant first look-up table A can be stored in the memory 5 in FIG. 1 if it has a memory capacity of about 96 Kbytes.
According to this method, when the data (IR, IG, and IB) input from the scanner 2 are image data at representative points, color correction can be properly performed by looking up the first look-up table A and using equations (2a) to (2c) given above. If, however, the image data deviate from representative points, the errors to be looked up are not present in the first look-up table A.
In this case, if equations (2a) to (2c) given above are directly used, the inputs (IR, IG, and IB) do not coincide with the outputs (OR, OG, and OB) except for the representative points, as indicated by the color correction input/output characteristics in FIG. 3, resulting in poor gradation reproducibility. If color correction is performed for the image data with such characteristics, an undesired phenomenon such as a Mach band occurs.
To perform proper color correction for image data deviating from representative points, therefore, linear interpolation is performed for the first errors in the first look-up table A to obtain proper errors. As disclosed in Japanese Patent Publication Sho 55 No. 30222, in the prior art, linear interpolation is performed by computing the following equations for each image point: ##EQU2## where R, G and B are the R, G, and B data components before color correction, C, M, and Y are the color data components after color correction, and l, m, and n are the respective dimensions of the three-dimensional coordinate system.
When errors are defined in an LUT, the following advantages can be generally obtained. First, since the absolute values of errors in conversion for color correction or the like can be decreased, the number of bits of the errors defined in the LUT can be decreased. Second, since portions with zero errors need not be defined in the LUT, the corresponding memory capacity can be saved.
In the above method based on polynomial approximation, since no LUT is required, a large memory is not required. However, since complicated correction computations must be executed, a long processing time is required.
In the above method using an LUT, the computations for correction processing can be relatively simplified. However, a large memory is required for the LUT. According to the method in which an LUT is prepared for only representative points, the memory capacity required for the LUT can be reduced. When, however, the above linear interpolation is done by software, since complicated computations with frequent access to the memory are required, it takes much time to perform the processing. This processing therefore inevitably calls for dedicated hardware.